<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1">
    <title id="bv20941">DROP USER MAPPING</title>
    <body>
        <p id="sql_command_desc">Removes a user mapping for a foreign server.</p>
        <section id="section2">
            <title>Synopsis</title>
            <codeblock id="sql_command_synopsis">DROP USER MAPPING [ IF EXISTS ] { <varname>username</varname> | USER | CURRENT_USER | PUBLIC } 
    SERVER <varname>servername</varname></codeblock>
        </section>
        <section id="section3">
            <title>Description</title>
            <p><codeph>DROP USER MAPPING</codeph> removes an existing user mapping from a foreign
                server. To run this command, the current user must be the owner of the server
                containing the mapping.</p>
        </section>
        <section id="section4">
            <title>Parameters</title>
            <parml>
                <plentry>
                    <pt>IF EXISTS</pt>
                    <pd>
                        <p>Do not throw an error if the user mapping does not exist. Greenplum Database issues a notice in this case.</p>
                    </pd>
                </plentry>
                <plentry>
                    <pt><varname>username</varname></pt>
                    <pd>
                        <p>User name of the mapping. <codeph>CURRENT_USER</codeph> and <codeph>USER</codeph> match the name of the current user. <codeph>PUBLIC</codeph> is used to match all present and future user names in the system.</p>
                    </pd>
                </plentry>
                <plentry>
                    <pt><varname>servername</varname></pt>
                    <pd>
                        <p>Server name of the user mapping.</p>
                    </pd>
                </plentry>
            </parml>
        </section>
        <section id="section6">
            <title>Examples</title>
            <p>Drop the user mapping named <codeph>bob</codeph>, server <codeph>foo</codeph> if it exists:</p><codeblock>DROP USER MAPPING IF EXISTS FOR bob SERVER foo;</codeblock>
        </section>
        <section id="section7">
            <title>Compatibility</title>
            <p><codeph>DROP SERVER</codeph> conforms to ISO/IEC 9075-9 (SQL/MED). The <codeph>IF EXISTS</codeph> clause is a Greenplum Database extension.</p>
        </section>
        <section id="section8">
            <title>See Also</title>
            <p><codeph><xref href="CREATE_USER_MAPPING.xml#topic1">CREATE USER MAPPING</xref></codeph>,
                        <codeph><xref href="ALTER_USER_MAPPING.xml#topic1">ALTER
                    USER MAPPING</xref></codeph></p>
        </section>
    </body>
</topic>
